package com.wyl.log

import org.springframework.aop.AfterReturningAdvice
import org.springframework.aop.MethodBeforeAdvice
import org.springframework.stereotype.Component
import java.lang.reflect.Method

@Component
class Log :MethodBeforeAdvice,AfterReturningAdvice{

    override fun before(method: Method, args: Array<Any>, target: Any?) {
        println("${target?.javaClass!!.name}的${method.name}方法被执行的")
    }

    override fun afterReturning(returnValue: Any?, method: Method, args: Array<Any>, target: Any?) {
        println("${target?.javaClass!!.name}的${method.name}方法被返回结果为${returnValue}")
    }

}